# 视频转语音服务数据模型

from typing import Dict, Any, Optional
from pydantic import BaseModel, Field

class VideoToSpeechResponse(BaseModel):
    """
    视频转语音响应模型
    """
    message: str = Field(..., description="处理结果消息")
    speech_url: str = Field(..., description="生成的语音文件URL")
    duration: float = Field(..., description="原始视频时长(秒)")
    language: str = Field(..., description="使用的语言")
    speed: float = Field(..., description="语音速度")
    original_format: str = Field(..., description="原始视频格式")
    
    model_config = {
        "json_schema_extra": {
            "example": {
                "message": "视频转语音成功",
                "speech_url": "/downloads/speech_123456.mp3",
                "duration": 120.5,
                "language": "zh",
                "speed": 1.0,
                "original_format": "mp4"
            }
        }
    }

class AudioExtractionResponse(BaseModel):
    """
    音频提取响应模型
    """
    message: str = Field(..., description="处理结果消息")
    audio_url: str = Field(..., description="提取的音频文件URL")
    duration: float = Field(..., description="原始视频时长(秒)")
    format: str = Field(..., description="音频格式")
    
    model_config = {
        "json_schema_extra": {
            "example": {
                "message": "音频提取成功",
                "audio_url": "/downloads/audio_123456.mp3",
                "duration": 120.5,
                "format": "mp3"
            }
        }
    }

class ErrorResponse(BaseModel):
    """
    错误响应模型
    """
    detail: str = Field(..., description="错误详情")
    
    model_config = {
        "json_schema_extra": {
            "example": {
                "detail": "请求处理过程中发生错误"
            }
        }
    }